<?php echo form_open('admin/articles_ctrl/search_by')?>
													<select name="search_by" id="pub" class="select2_category form-control" data-placeholder="Choose a Category" tabindex="1">
														<option value="">select</option>
														<?php foreach($articles_fileds as $article_k => $article_v):?>
														<?php if($search_by == $article_k){?>
															<option selected="selected" value="<?php echo $article_k;?>"><?php echo $article_v;?></option>
														<?php }else{?>
															<option value="<?php echo $article_k;?>"><?php echo $article_v;?></option>
														<?php }?>
														<?php endforeach;?>
													</select><?php echo form_error('search_by');?>
													<input type="text" value="<?php if($search_by !== 'publish_date' && $search_by !== 'status'): echo $search_by_value; else: echo ''; endif; ?>" name="search" id="article_search" class="form-control" placeholder="search"/>
													<input type="date" value="<?php if($search_by == 'publish_date'): echo $search_by_value; else: echo ''; endif; ?>" name="search_date" id="article_date" class="form-control" placeholder="search"/>
													<select name="status" id="article_status" class="select2_category form-control" data-placeholder="Choose a Category" tabindex="1">
														<option value="">select</option>
														<?php foreach($status as $status_k=>$status_v):?>
														<?php if($search_by == 'status' && $search_by_value == $status_k):?>
															<option selected="selected" value="<?php echo $status_k;?>"><?php echo $status_v;?></option>
														<?php else: ?>
															<option value="<?php echo $status_k;?>"><?php echo $status_v;?></option>
														<?php endif; endforeach;?>
													</select><?php echo form_error('search_by');?>
												<input type="submit" class="btn blue" value="Search"/>
												<?php echo form_close();?>
												
											</div>
										</div>
									</div>
								</div>
								<?php if($error == 1){
									echo 'No Records Found <br>';
									echo anchor('admin/articles_ctrl/index','Back');
								}else{ ?>
								<table class="table table-striped table-hover table-bordered" id="sample_editable_1">
								<thead>
								<tr>
								<?php foreach($articles_fileds as $article_k => $article_v):?>
									<th>
										<?php echo anchor('admin/articles_ctrl/index/'.$query_id.'/'.$article_k.'/'.(($sort_order=='asc' && $order_by==$article_k)?'desc':'asc'),$article_v);?>
									</th>
								<?php endforeach;?>
									<th>
										 Edit
									</th>
									<th>
										 Delete
									</th>
								</tr>
								</thead>
								<tbody>
								<?php echo 'Total Records: '.$articles_get_articles->total;?>
								<?php //print_r($articles_get_articles);exit;?>
								<?php foreach($articles_get_articles->info as $value):?>
								<tr>
									<td>
										 <?php echo $value->article_title?>
									</td>
									<td>
										 <?php echo $value->article_type?>
									</td>
									<td>
										 <?php echo $value->author_title.$value->first_name.$value->middle_name	.$value->last_name?>
									</td>
									<td>
										 <?php echo $value->publish_date?>
									</td>
									<td>
										 <?php if($value->status == 1){?>
										 <i class="fa fa-check"></i>
										 <?php }else{ ?>
										 <i class="fa fa-times"></i>
										  <?php } ?>
									</td>
									<td>
										<a class="edit" href="<?php echo base_url().'index.php/admin/articles_ctrl/edit_article_page/'.$value->article_id;?>">
										Edit </a>
									</td>
									<td>
										<a class="delete" href="<?php echo base_url().'index.php/admin/articles_ctrl/delete_article/'.$value->article_id.'/'.$value->status;?>">
										<?php if($value->status == 1){?>
										 Delete
										 <?php }else{ ?>
										 Active
										  <?php } ?></a>
									</td>
								</tr>
								<?php endforeach;?>
								
							</table>
							<?php echo $pagination;?>
						<!-- END EXAMPLE TABLE PORTLET-->
					</div>
				</div>
								<?php } ?>